 package fr.vvins.core.order.entity;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import fr.vvins.core.catalog.entity.Product;
import fr.vvins.core.dao.EntityImpl;

/**
 * CommerceItem entity
 */
@Entity
@Table(schema="vvins", name="VV_COMMERCE_ITEM")
public class CommerceItem extends EntityImpl implements Serializable {

	private static final long serialVersionUID = -1536657121622143850L;
	@Id
	@GeneratedValue
	@Column(name="id")
	private Integer id;
	@ManyToOne
	@JoinColumn(name="ORDER_ID")
	private Order order;
	@ManyToOne
	@JoinColumn(name="PRODUCT_ID")
	private Product product;
	@Basic
	@Column(name="QUANTITY")
	private Integer quantity;
	@Basic
	@Column(name="PRICE")
	private String price;

	public CommerceItem() {
	}

	public CommerceItem(Integer id, Order order, Product product, Integer quantity,
			String price) {
		super();
		this.id = id;
		this.order = order;
		this.product = product;
		this.quantity = quantity;
		this.price = price;
	}


	@Override
	public Integer getId() {
		return id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}


}
